<?php
/**
 * @Project NUKEVIET 3.3
 * @Author Đặng Đình Tứ(dlinhvan@gmail.com)
 * @Copyright (C) 2012
 * @Createdate 25-02-2012 12:00
 */
if ( ! defined( 'NV_SYSTEM' ) ) die( 'Stop!!!' ); 
	global  $global_config, $my_head,$module_info;

	if (file_exists(NV_ROOTDIR . "/themes/" . $module_info['template'] . "/blocks/global.slide.tpl"))
    {
        $block_theme = $module_info['template'];
    }
      
    $xtpl = new XTemplate("global.slide.tpl", NV_ROOTDIR . "/themes/" . $block_theme . "/blocks/");
	$my_head .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "themes/" . $block_theme . "/js/slide_show.js\"></script>\n";
    $my_head .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . NV_BASE_SITEURL . "themes/" . $block_theme . "/css/slide_show.css\" />\n";
	
	$filelist = nv_scandir( NV_ROOTDIR . '/'.NV_UPLOADS_DIR.'/slide', "/^([a-zA-Z0-9\_\.]+)\.^([a-zA-Z0-9\_\.]+)$/" );
	foreach($filelist as $img)
	{
		$images = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/slide/'.$img;
		$xtpl->assign( 'loop', $images );
        $xtpl->parse( 'main.loop' );
	}
	
	$xtpl->parse( 'main' );
    $content = $xtpl->text( 'main' );

	
?>